import * as Router from 'koa-router';
import {koaBody} from 'koa-body'
import { DataExporter } from '../module/exportData';
import { UserModule } from '../module/user';
import { ChapterModule } from '../module/chapter';
//用来签名的密钥

const router = new Router();

router.prefix('/api')

router.post("/chapter-list", koaBody(), async ctx => {
  const { body } = ctx.request as any;
  // 查询分会列表
  let result = await ChapterModule.ins.getChapterList(body);
  ctx.body = {
    ret: 0,
    data: result
  };
});

router.post("/chapter-members", koaBody(), async ctx => {
  const { body } = ctx.request as any;
  // 查询分会列表
  let result = await ChapterModule.ins.getChapterMembers(body);
  ctx.body = {
    ret: 0,
    data: result
  };
});

export default router
